.All interfaces of the platform transmit data in UTF-8 encoding. UTF-8 enters UTF-8.
.All script files should be saved in UTF-8 encoding (not UTF-8+).
.The interface info returns the server state and system state;
.Interface ask, www is responsible for answering webpage embedded scripts
.The interface upfile is responsible for receiving the file in the formdata mode (fname single file, multi-file, please submit it in a loop), save the file to the directory of the upload configuration and return the file address, and create a date directory;
.The interface upfile2 is responsible for receiving the file in the formdata mode (fname single file, multi-file, please submit it in a loop), save the file to the directory of the upload configuration and return the file address, and create a date directory;
.The interface upcache is responsible for receiving the file in the formdata mode (fname single file, multi-file, please submit it in a loop), save the file to the cache temporary directory and return the file address, and create a date directory;
.The interface upfiles is responsible for receiving the file in the formdata mode (fpath, fname single file, multi-file, please submit it in a loop), save the file to the specified web path and return the file address, and will not create a date directory;
.The interface restart is responsible for restarting the server, which will shut down the service and restart.
.Support upload path settings, specify url and disk path, set [Upload] item in the configuration file, only the first record is valid;
.Support for pascal syntax script parsing;
.Support settings such as virtual directory, default page and output type, please set in the configuration;
.Support Chinese directory identification and output;
.Support web services, static text, binary data output;
.Support HOST redirection, 301 domain transfer, for browsers, does not affect the interface;
.Support for pseudo-static pages, dynamic scripts generate pseudo-static pages to optimize the inclusion of search engines;
.Support for JavaScript cross-domain settings;
.Support gzip compression mode;
.Support IP blacklist settings;
.Support for browser cache settings in time units;
.Support for multiple domain name bindings, domain names corresponding to different script directories.


List of built-in functions:

1.HTTP HTTP/HTTPS Request forwarding function (no cross-domain restrictions)
  (*
    caption:HTTP request, support ssl
    format:http(url,params,headers,method JSON|SOAP|FILE|GET|POST|DELETE,
    _______timeout millisecond,requestCoding 65001|936,responseCoding 65001|936,
    _______encoding true|false,decoding true|false);
    params:url.asText,params.asText,headers.asText,method.asText,
    _______timeout.asInteger,requestCoding.asInteger,responseCoding.asInteger,
    _______encoding.asBoolean,decoding.asBoolean;
    result:asText
    example:HTTP('http://offeu.com/utf8.txt','','','GET',10000,65001,65001,false,false);
    HTTP('http://localhost:8833/upfile','fname=file(/data.json)&utt=xxoo','','FILE',10000,65001,65001,false,false);
  *)
2.DBConn/DBExec/DBQuery/DBQueryToJson/DBQueryToTxt/DBQueryToExcel Database operation (Note: Without transaction control)
  (*
    caption:Add data source (database connection source)
    format:DBConn(name,params);
    params:name.asText,params.asText
    result:asBoolean
    example:DBConn('mydb','DriverID=MSAcc;Database=.\db.mdb');
    Note: Only allowed to add, do not overwrite does not delete
    (emptied restart the service), the new success will be added to return True.
    If you overwrite or delete the connection, it will affect the concurrent
    use, so it will be better to empty the service restart.
  *)
  (*
    caption:Execute SQL statements
    format:DBExec(conn,sql[,P1,...,Pn]);
    params:conn.asText,sql.asText
    result:asBoolean
    example:DBExec('mydb','update tuser set fuser=:p1 where fid=1','admin');
  *)
  (*
    caption:Use SQL statements to query the database
    format:DBQuery(conn,sql[,P1,...,Pn]);
    params:conn.asText,sql.asText
    result:asDataset
    example:DBQuery('mydb','select * from tuser where fname=:p1','admin');
  *)
  (*
    caption:Use SQL statements to query the database and output json
    format:DBQueryToJSON(conn,sql[,P1,...,Pn]);
    params:conn.asText,sql.asText
    result:asText
    example:DBQueryToJSON('mydb','select * from tuser where fname=:p1','admin');
  *)
  (*
    caption:Use SQL statements to query the database and save it to a text file
    format:DBQueryToTxt(conn,sql[,P1,...,Pn]);
    params:conn.asText,sql.asText
    result:asText
    example:DBQueryToTxt('mydb','select * from tuser where fname=:p1','admin');
  *)
  (*
    caption:Use SQL statements to query the database and save it to a excel file
    format:DBQueryToExcel(conn,sql[,P1,...,Pn]);
    params:conn.asText,sql.asText
    result:asText
    example:DBQueryToExcel('mydb','select * from tuser where fname=:p1','admin');
  *)
3.URLencode String encoding/decoding function
  (*
    caption:URLencoding
    format:URLencode(content[,encode 65001|936[,encoding true|false]]);
    params:content.asText,encode.asInteger,encoding.asBoolean
    result:asText
    example:URLencode('123456',65001,true);
  *)
4.RegexCheck/Regex Regular expression value/check string
  (*
    caption:Use regular expressions to validate the data
    format:RegexCheck(content,regex);
    params:content.asText,regex.asText
    result:asBoolean
    example:RegexCheck('I am 18 years old forever','.*');
  *)
  (*
    caption:Use regular expressions to get the data
    format:Regex(content,regex);
    params:content.asText,regex.asText
    result:asRecord
    example:Regex('I am 18 years old forever','.*');
  *)
5.JsonToRecord/RecordToJson/JsonRead/JsonSave/JsonCheck Json and Record interchange, Json file read and save, Check Json.
  (*
    caption:Json string to Record set
    format:JsonToRecord(json);
    params:json.asText
    result:asRecord
    example:JsonToRecord('{"name": "Vincent","sex": "male"}');
  *)
  (*
    caption:Record set to Json string
    format:RecordToJson(Record);
    params:Record.asRecord
    result:asText
    example:RecordToJson(JsonToRecord('{"name": "Vincent","sex": "male"}'));
  *)
  (*
    caption:Read the file(json format) and converted into a record set
    format:JsonRead(filename);
    params:filename.asText
    result:asRecord
    example:JsonRead('/up/data.json');
  *)
  (*
    caption:Json string saved to the file
    format:JsonSave(json,filename);
    params:json.asText,filename.asText
    result:asBoolean
    example:JsonSave('{"a":"b"}','/up/data.json');
    Note: web path required / beginning, end can not /, not allowed to use .. \,
    web path and host settings related.
  *)
  (*
    caption:check json
    format:JsonCheck(Json);
    params:Json.asText
    result:asBoolean
    example:JsonCheck('{"a":"b"}');
  *)
6.UnicodeToAnsi Convert Unicode to Chinese
  (*
    caption:Convert unicode to Chinese
    format:UnicodeToAnsi(unicode);
    params:unicode.asText
    result:asText
    example:UnicodeToAnsi('{"name":"\u59d3\u540d","sex":"\u6027\u522b"}');
  *)
7.Base64ToFile Decode and save the base64 encoded file to a file and return the file name.
  (*
    caption:base64 decoding to file
    format:Base64toFile(unicode);
    params:base64.asText,filename.asText
    result:asText
    example:
    $f:=Base64ToFile('iVBORw0KGgoAAAANSUhEUgAAABMAAAARCAYAAAA/mJfHAAACz0lEQVQ4jXVUz2sTQRh9s7M/kiba'
    +'1KZSCq0HCQgteLMexINUL6KCIngQpFLBg/+A3kTPIiheFJGi4klPKl6sF7G11Wqp1FKkbWKsSW2y'
    +'TTfNZrM74+xOzKatHfKYH+R7+77vfTOkWq1ybBo/F6cwOfoM8zNvYRWyqJSKYDUPED/CDXT3HseZ'
    +'SzfR2Z1qxKyWqiCO4zTIOOf4/GEYlrmAzPc3yGemARcBSfO8vs4Rj7RgYOgu9h85F8QWijZU27Yb'
    +'7F8/DiOqE2Smn8AuFbDT0AG1TkTrswJEwRGjHibuXwb1XPQdPQ/PZSC5XC5Qll14j4r5DempR3DK'
    +'pgzcBopQGKdKsHZFYodvjMCN7JHKGPOw9OMVUJ4FdcuIUk3kjG3hi0wYFIpYcMIx9/g6egYfSLKV'
    +'pS9QaxlU1+YRoSIvJtPZAiJBFYKdqgq1vrdn3qG4lIVaqVRQ+j0GpZKDHhQoDArQPIj0ICZS9Ml0'
    +'Rf6BR2NIT45IMtfKIOJY4uO0bmsTGlZLcM93UhNkGgxG5LmhYjE9J8k8uwziKfKzPhjCddMZF4gI'
    +'NSpT0aoaUF0i0xfOUtsRparV4LEdcKs+mbLROQ8b9sT1U6SiGBQaMUL1jjAx2QlF13VoiT5oXg06'
    +'0SWUOshGaAK2Q5EUNQITPcj1YGarZbB9/VC7urrgJk+gmn+KWEtcqqj9p7/qZy2EoiNiyDMmla1F'
    +'dyO2txdqKiXvV8EcQlv6hci/LQzeDm5oDlv+BX7hmtiSoHzBaO2/gqKbFPl7MoV/4JuApvVaBWbq'
    +'ABIDp0BVJSRTRLPGTz+EWRa9ZllhANuGaLmAwq4eJK7eEs4IhwUZYYwFgv0XI5AtLu7q69vQJ54j'
    +'FmsXvdAeumwL1fk8rKIF9+QgEmcvNtpwdCwL8mdFvCd8y5MmrpaJ9fGXILOfQMyiICTg8Q6g9yBi'
    +'h45B8x2tD/8tu3NvHH8B9EZlK6ozLtkAAAAASUVORK5CYII=',formatdatetime('yyyyMMddhhmmsszzz".jpg"',now));
    if $f<>'error' then begin
    'File saved successfully, the file name is:'$f;' <img src="'$f'">'
    end else begin
    'File save failed.';
    end;
  *)
8.CAPTCHA Captcha image generation (data:image/jpeg;base64)
  (*
    caption:Generate captcha image data (base64)
    format:captcha(content[,quality]);
    params:content.asText,quality.asInteger
    result:asText
    example:captcha('abc123ABC',100);
  *)
9.QRCode QR code generation (data:image/jpeg;base64)
  (*
    caption:Generate QRCode image data (base64)
    format:qrcode(content[,quality[,multiple]]);
    params:content.asText,quality.asInteger,multiple.asInteger
    result:asText
    example:qrcode('abc123ABC',100,2);
  *)
10.GetDirList/GetDirFile/GetFileList/CopyFile/DeleteFile/MakeDir/RemoveDir/FileExists/DirectoryExists/
   FileSize/FileDateTime/DirDateTime File operation related function
  (*
    caption:Get a list of directories, excluding subdirectories
    format:GetFileList(path);
    params:path.asText
    result:asArray
    example:GetFileList('/');
  *)
  (*
    caption:Get a list of files, excluding files in subdirectories
    format:GetDirFile(path);
    params:path.asText
    result:asRecord.asArray['r']
    example:GetDirFile('/');
  *)
  (*
    caption:Get a list of files, including files in subdirectories
    format:GetFileList(path);
    params:path.asText
    result:asRecord.asArray['r']
    example:GetFileList('/');
  *)
  (*
    caption:copy file
    format:CopyFile(Source,target);
    params:Source.asText,target.asText
    result:asBoolean
    example:CopyFile('/cache/a.jpg','/up/a.jpg');
    Note: The directory will not be created, and if the target directory does
    not exist, replication will fail
  *)
  (*
    caption:Delete the specified file
    format:DeleteFile(filename);
    params:filename.asText
    result:asBoolean
    example:DeleteFile('/up/a.png');
  *)
  (*
    caption:Create a directory
    format:MakeDir(dir);
    params:dir.asText
    result:asBoolean
    example:MakeDir('/up/aaa');
  *)
  (*
    caption:Delete the specified directory
    format:RemoveDir(path);
    params:path.asText
    result:asBoolean
    example:RemoveDir('/up/aaa');
  *)
  (*
    caption:Judge whether the file exists
    format:FileExists(filename);
    params:filename.asText
    result:asBoolean
    example:FileExists('/up/a.png');
  *)
  (*
    caption:Judge whether the path exists
    format:DirectoryExists(path);
    params:path.asText
    result:asBoolean
    example:DirectoryExists('/up/aaa');
  *)
  (*
    caption:Get the file size
    format:FileSize(filename);
    params:filename.asText
    result:asLargeInt Int64
    example:FileSize('/up/a.png');
  *)
  (*
    caption:Get the file date and time
    format:FileDateTime(filename);
    params:filename.asText
    result:asDateTime
    example:FileDateTime('/up/a.png');
  *)
  (*
    caption:Get the Directory date and time
    format:DirDateTime(path);
    params:path.asText
    result:asDateTime
    example:DirDateTime('/up');
  *)
11.Include Contains an external script file that returns the execution result of the script file
  (*
    caption:Load the script file and return the execution result of the script file
    format:Include(filename);
    params:filename.asText
    result:asText
    example:Include('admin\login.api');
  *)
12.MergePng Combine multiple png files into one jpg file
  (*
    caption:Merge png pictures and output picture data (base64)
    format:MergePng(quality,width,height,objFile,srcFile1[,srcFile2,...,srcFileN]);
    params:quality.asInteger,width.asInteger,height.asInteger,
    _______objFile.asText,srcFile1.asText
    result:asText data:image/jpeg;base64,....
    example:MergePng(100,2048,1536,'abc.jpg','c:\1.jpg','c:\2.jpg');
  *)
13.GetMachineInfo Used to obtain software and hardware information, such as BIOS information, UUID code, CPU information, computer name, Win system GUID, etc.
  (*
    caption:Used to obtain hardware and software information
    format:GetMachineInfo;
    params:
    result:asText
    example:GetMachineInfo;
    Note: UUID unchanged, reinstall the system does not affect win and mac;
    CPUID the same batch; Win system GUID reinstall the system will change.
  *)
14.UnZip Unzip the zip file
  (*
    caption:Unzip the zip file
    format:UnZip(filename,path);
    params:filename.asText,path.asText
    result:asText {"result":"success or error","msg":""}
    example:UnZip('/up/abc.zip','/up');
  *)
15.Exit/Error Stop executing subsequent scripts and return information. Error throws an exception and stops executing subsequent scripts. Exit throws a prompt and stops executing subsequent scripts.
  (*
    caption:Exit the current script, the output prompt
    format:Exit(content);
    params:content.asText
    result:rtc_Text Exit('abc') result abc
    example:Exit('abc');
    Note: The contents of the front of the function will be executed normally,
    the variable is valid, the execution result can be output by this function
  *)
  (*
    caption:Exit the current script, the output prompt
    format:Error(content);
    params:content.asText
    result:rtc_Text Error('abc') result {"result":"error","msg":"abc"}
    example:Error('abc');
    Note: The contents of the front of the function will be executed normally,
    the variable is valid, the execution result can be output by this function
  *)
16.WeChat interface related
  (*
    caption:Weixin Encrypt Msg
    format:WxEncryptMsg(sMsg,sToken,sCorpid,sEncodingAESKey);
    params:param.asText
    result:asText
  *)
  (*
    caption:Weixin Decrypt Msg
    format:WxDecryptMsg(sToken,sTimestamp,sNonce,sMsgEncrypt,
    sMsg_signature,sCorpid,sEncodingAESKey);
    params:param.asText
    result:asText
  *)
17.Plan task related
  (*
   caption:Get plan task status
   format:taskinfo
   params:
   result:asText
   example:taskinfo;
  *)
  (*
   caption:Pause plan task(Suspended)
   format:TaskPause(TaskID,Suspended);
   params:TaskID.asInteger,Suspended.asBoolean;
   result:asBoolean;
   example:taskpause(true);
  *)
  (*
   caption:Load plan task
   format:TaskPause(TaskID,ScriptFileName);
   params:TaskID.asInteger,ScriptFileName.asText;
   result:asBoolean;
   example:taskload(0,'test.api');
  *)
18.Hash algorithm related
  (*
    caption:Hash algorithm
    format:HASH(content,algorithm[,format]);
    params:Text,Text(MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA512_224,SHA512_256)[,Text(Hex/Base64)]
    result:Text
    example:hash('123456','md5','hex');
  *)
  (*
    caption:hmac hash algorithm
    format:HMAC(content,key,algorithm[,format]);
    params:Text,Text,Text(MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA512_224,SHA512_256)[,Text(Hex/Base64)]
    result:Text
    example:hmac('123456','key','md5','hex');
  *)
19.Execute external programs and capture results
  (*
    caption:Execute CMD and return results
    format:RunCMD(command);
    params:Text
    result:Text
    example:RunCMD('dir /ad c:\');
  *)

n.Other functions
  Length		Return string length							<?length('12345')?>
  Trim			Clear the left and right spaces of the string				<?trim(' abc ')?>
  Now			Get current date and time						<?formatdatetime('yyyy-MM-DD hh:mm:ss.zzz',now);?>
  StrToDatetime		Convert a string to a datetime						<?formatdatetime('yyyy-MM-DD hh:mm:ss.zzz',StrToDatetime('2019-01-01 00:00:00'));?>
  FormatDateTime	Formatted date								<?formatdatetime('yyyy-MM-DD hh:mm:ss.zzz',now);?>
  FormatFloat		Formatted float								<?formatfloat('#,##0.#0',555.55);?>
  FormatCapacity	Formatted capacity display						<?formatcapacity(1024);?>
  Pos			Position the character in the string					<?copy('abcdefg',pos('e','abcdefg'),2);?>
  Copy			Copy the specified number of strings from the specified location	<?copy('abcdefg',pos('e','abcdefg'),2);?>
  Sort			Sort strings								<?sort('a','c','d');?>
  Split			Split strings								<?split('a,c,d',',');?>
  Log			Log information to the log directory					<?log('test','Server log');?>
  AES			AES encoding the string							<?AES('123456','key',true,128,true);?>//The last parameter is false to decrypt, and the third is ECB mode.
  DES			DES encoding a string							<?DES('123456','key',true);?>//The last parameter is false to decrypt.
  BlowFish		BlowFish encoding the string						<?BlowFish('123456','key',true,'ECB','Hex');?>
  BASE64		BASE64 encoding a string						<?base64('123456',true);'|'base64('MTIzNDU2',false);?>
  MD5			MD5 encoding a string							<?md5('123456');?>
  FileMD5		Get file MD5 encoding							<?FileMD5('/up/a.png');?>
  FileSHA1		Get file SHA1 encoding							<?FileSHA1('/up/a.png');?>
  StrToFloat		Convert a string to a float						<?StrToFloat('55.55');?>
  Trunc			Take a floating-point integer part, not rounding			<?Trunc(55.55);?>
  ABS			Absolute absolute value							<?ABS(-100.55);?>
  Random		Get random number							<?Random(100);?>
  LowerCase		Letter to lowercase							<?LowerCase('TEST');?>
  UpperCase		Letter to uppercase							<?UpperCase('test');?>
  QuotedStr		Add single quotes around the string					<?QuotedStr('test');?>
  Replace		Replace the specified content, support the regex			<?Replace('I am a wolf from the north!','(?<=am a).*?(?=from)','bear')?>
  Sleep			Sleep specified milliseconds						<?Sleep(1000);?>
  Timestamp		Get Unix timestamp							<?Timestamp;?>
  TimestampToDateTime	Restore Unix timestamps to date types					<?FormatDateTime('yyyy-MM-DD hh:mm:ss',TimestampToDateTime(Timestamp));?>
  GetPort		Get the currently open service port					<?GetPort;?>
  Snowflake		Get unique ID								<?Snowflake(1);?>